import { Injectable } from '@nestjs/common';
import { RedisService } from 'nestjs-redis';
import { Redis } from 'ioredis';

@Injectable()
export class RedisClientService {
  public redisClient: Redis;
  constructor(private redisService: RedisService) {}

  onModuleInit() {
    console.log('开始连接redis');
    this.getClient();
  }

  public getClient() {
    this.redisClient = this.redisService.getClient();
  }
}
